package com.linwen.tips.tools;

import com.linwen.tips.tools.bean.PasswordInfo;
import org.springframework.stereotype.Component;

import java.util.regex.Matcher;
import java.util.regex.Pattern;


@Component
public class PasswordServiceImpl {

    private static final String EMAIL_REGEX =
            "^[A-Za-z0-9+_.-]+@(.+)$";

    public void resetPassword(PasswordInfo passwordInfo) {
        Pattern pattern = Pattern.compile(EMAIL_REGEX);
        Matcher emailMatcher = pattern.matcher(passwordInfo.getEmail());
        if (!emailMatcher.matches()) {
            System.out.println("Invalid email address.");
            return ;
        }
        //发送通知修改密码
        sendReSetPasswordNotify();
    }




    private void sendReSetPasswordNotify() {

    }

}
